<template>
        <div class="app2">
            子组件1
            <h4>玩具：{{ toy }}</h4>
            <button @click="emitter.emit('send-toy',toy)">玩具给子组件2</button>
        </div>
</template>
    
<script setup lang='ts'>
import { ref } from 'vue';
import emitter from '@/utils/emitter';
let toy = ref('奥特曼')


</script>
    
<style scoped>
    .app2{
        padding: 10px;
        margin: 10px;
        background-color: skyblue;
        border-radius: 5px;
        box-shadow: 0 0 10px ;
    }
</style>